import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { HeroService } from '../../../../services/hero.service';
import { NzModalService } from 'ng-zorro-antd';

@Component({
  selector: 'app-printerbillinfo',
  templateUrl: './printerbillinfo.component.html',
  styleUrls: ['./printerbillinfo.component.css']
})
export class PrinterbillinfoComponent implements OnInit {

  public data:Array<any>=[''];
  public user:Array<any>=[''];
  constructor(private heroService: HeroService,
              private route: ActivatedRoute,
              private modalService: NzModalService) { }

  ngOnInit() {
    this.getbillinfo();
  }

//获取设备抄表账单详情数据
  getbillinfo(){
    const id= this.route.snapshot.params["id"]; 
    let url=host+"/main/printerBill/view?id="+id;
    this.heroService.get(url).then(result=>{
      if(result.code==0){
        this.data[0]=result.data.bean;
        this.user[0]=result.data.connectUser;
      }else{
        this.modalService.error({
          nzTitle: '提示',
          nzContent: result.msg
        });
      }
    })
  }
}
